package com.stone.design.mode.pipeline.tomcat.client;

import com.stone.design.mode.pipeline.tomcat.Pipeline;
import com.stone.design.mode.pipeline.tomcat.PipelineContext;
import com.stone.design.mode.pipeline.tomcat.StandardPipeline;
import com.stone.design.mode.pipeline.tomcat.StandardPipelineContext;
import com.stone.design.mode.pipeline.tomcat.valve.ForTestValve;
import com.stone.design.mode.pipeline.tomcat.valve.GraySwitchValve;
import com.stone.design.mode.pipeline.tomcat.valve.PipelineValve;

/**
 * 入口类
 *
 * @author wenpan 2023/11/17 9:54 下午
 */
public class PipelineClient {

    public static void main(String[] args) {

        // 管道初始化
        Pipeline pipeline = new StandardPipeline();

        // value扩展
        PipelineValve pipelineValve = new GraySwitchValve();
        PipelineValve pipelineValve2 = new ForTestValve();

        // 上下文
        PipelineContext pipelineContext = new StandardPipelineContext();

        pipeline.addValue(pipelineValve);
        pipeline.addValue(pipelineValve2);

        // 调用管道
        pipeline.invoke(pipelineContext);

    }
}